function e(e, t) {
	if (e && t) {
		for (var a = e.split("."), o = t.split("."), n = Math.min(a.length, o.length), i = 0, d = 0; i < n && 0 == (d =
				parseInt(a[i]) - parseInt(o[i]));) i++;
		return (d = 0 != d ? d : a.length - o.length) >= 0;
	}
	return console.log("版本号不能为空"), !1;
}

var t, a = function(e) {
	return e && e.__esModule ? e : {
		default: e
	};
}(require("../../../utils/tools.js"));

getApp();

Page({
	data: {
		pageName: "tx" 
	},
	onLoad: function(e) {
		t = this;
	},
	onReady: function() {
		var o = {
			action: "index",
			contr: "my",
			token: wx.getStorageSync("token")
		};
		a.default.request(o, function(a) {
			var item = {
				"pageName": "tx",
				"text": "探险",
				"iconPath": "https://www.shangjinya.com/addons/bh_farm/template/static/images/xcx/a17.png",
				"selectedIconPath": "https://www.shangjinya.com/addons/bh_farm/template/static/images/xcx/a15.png",
				"index": 2,
				"visible": true
			}
			var tabs = a.info.list
			var newTabs = [tabs[0], item, tabs[3], tabs[4]]
			a.info.list = newTabs
			t.setData(a.info);
			var o = wx.getSystemInfoSync();
			console.log(6969696), t.data.videoAd1 = null, console.log(a.info.adUnitId), console.log(e(o.SDKVersion, "2.0.4")),
				a.info.adUnitId && e(o.SDKVersion, "2.6.0") && (console.log(99995841), t.data.videoAd1 = wx.createRewardedVideoAd({
					adUnitId: a.info.adUnitId
				}), t.setData({
					ad_load: !0
				}));
		});
	},
	navigatorSwitch: function(e) {
		console.log(e.detail.pageName);
		var t = e.detail.pageName;
		if (t != this.data.pageName) {
			if ("index" == t) a = "/bh_farm/pages/index/index";
			else if ("recruit" == t) a = "/bh_farm/pages/recruit/recruit";
			else if ("mine" == t) a = "/bh_farm/pages/my/my";
			else if ("pdd" == t) a = "/bh_farm/pages/pdd/pdd";
			else if ("db" == t) var a = "/bh_farm/pages/treasure/treasure";
			wx.redirectTo({
				url: a
			});
		}
	}
});
